package com.qianniu.napi.admin.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author chenxuebin
 * @since 2018-06-23
 */
@TableName("v_goods_category")
public class GoodsCategoryView extends Model<GoodsCategoryView> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
	private String name;
	private String key;
    /**
     * 分类级别，1为顶级分类
     */
	private Integer level;
	private Integer paixu;
    /**
     * 上级分类编号，0代表顶级分类
     */
	private Integer pid;
	private String pname;
    /**
     * 分类类型，可自定义
     */
	private String type;

	@TableField("has_child")
	private boolean hasChild;

	@TableField("is_nav")
	private Integer isNav;

	@TableField(exist = false)
	private List<GoodsCategoryView> childs= new ArrayList<GoodsCategoryView>();

	@TableField(exist = false)
	private List<Goods> goods = new ArrayList<Goods>();

	private Integer state;
	private Long uid;
	private Long mid;
	private Long mpid;
	private Long modifier;
    /**
     * 图标地址
     */
	private String pic;
	private Date createtime;
	private Date modifytime;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getPaixu() {
		return paixu;
	}

	public void setPaixu(Integer paixu) {
		this.paixu = paixu;
	}

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public boolean getHasChild() {
		return hasChild;
	}

	public void setHasChild(boolean hasChild) {
		this.hasChild = hasChild;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Long getMid() {
		return mid;
	}

	public void setMid(Long mid) {
		this.mid = mid;
	}

	public Long getMpid() {
		return mpid;
	}

	public void setMpid(Long mpid) {
		this.mpid = mpid;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public Integer getIsNav() {
		return isNav;
	}

	public void setIsNav(Integer isNav) {
		this.isNav = isNav;
	}

	public List<GoodsCategoryView> getChilds() {
		return childs;
	}

	public void setChilds(List<GoodsCategoryView> childs) {
		this.childs = childs;
	}

	public List<Goods> getGoods() {
		return goods;
	}

	public void setGoods(List<Goods> goods) {
		this.goods = goods;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public Date getModifytime() {
		return modifytime;
	}

	public void setModifytime(Date modifytime) {
		this.modifytime = modifytime;
	}

	public Long getModifier() {
		return modifier;
	}

	public void setModifier(Long modifier) {
		this.modifier = modifier;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "GoodsCategory{" +
			"id=" + id +
			", name=" + name +
			", key=" + key +
			", level=" + level +
			", paixu=" + paixu +
			", pid=" + pid +
			", type=" + type +
			", state=" + state +
			", uid=" + uid +
			", pic=" + pic +
			", createtime=" + createtime +
			", modifytime=" + modifytime +
			"}";
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}
}
